import React, { Component } from 'react'
import { ListBox } from '../../../components'


import { fetchData } from '../../../components/AjaxConsumer'
import { Button, Modal, Form, Input, Radio, Upload, Icon } from 'antd';
export default class ListLockLog extends Component {
    constructor(props) {
        super(props);
        this.state = {
            tableColumn: {},
            searchComponentData: [],
            visible: false,
        };
        //行操作列表
        this.rowOperation = [

        ];
        //header 操作列表
        this.headerOperation = [

        ];

        //table列表展示列配置
        //showName、columnName 必有属性， columnWidth 可选，默认100, columnHidden: true 列隐藏
        this.tableColumn = {
            storageKey: 'listLockLog',
            data: [
                {
                    showName: 'lockLogId',
                    columnName: 'lockLogId',
                    columnHidden: true,
                    foreverHidden: true
                }, {
                    showName: '条码',
                    columnName: 'barcode'
                }, {
                    showName: '型号',
                    columnName: 'model'
                }, {
                    showName: '型号描述',
                    columnName: 'modelDesc'
                }, {
                    showName: '冻结原因',
                    columnName: 'lockReason',
                    showOption: [//页面显示配置
                        {
                            optionKey: '0',
                            optionShow: '下线即冻结'
                        }, {
                            optionKey: '1',
                            optionShow: '抽检冻结'
                        }, {
                            optionKey: '2',
                            optionShow: '质量冻结'
                        }, {
                            optionKey: '4',
                            optionShow: '手工冻结'
                        }
                    ]
                }, {
                    showName: '操作类型',
                    columnName: 'lockType',
                    showOption: [//页面显示配置
                        {
                            optionKey: '0',
                            optionShow: '解冻'
                        }, {
                            optionKey: '1',
                            optionShow: '冻结'
                        }
                    ]
                }, {
                    showName: '操作人',
                    columnName: 'lockBy'
                }, {
                    showName: ' 库位',
                    columnName: 'wlCode'
                }, {
                    showName: '操作时间',
                    columnName: 'lockDate'
                }
            ]
        };

        //搜索属性配置
        this.searchComponentData = [
            {
                showName: '冻结原因',
                name: 'lockReason',
                type: 'select',
                optionList: [
                    {
                        optionKey: '',
                        optionShow: ''
                    },
                    // {
                    //     optionKey: '0',
                    //     optionShow: '下线即冻结'
                    // }, {
                    //     optionKey: '1',
                    //     optionShow: '抽检冻结'
                    // },
                    {
                        optionKey: '2',
                        optionShow: '质量冻结'
                    }, {
                        optionKey: '4',
                        optionShow: '手工冻结'
                    }
                ]
            }, {
                showName: '操作类型',
                name: 'lockType',
                type: 'select',
                optionList: [
                    {
                        optionKey: '',
                        optionShow: ''
                    }, {
                        optionKey: '0',
                        optionShow: '解冻'
                    }, {
                        optionKey: '1',
                        optionShow: '冻结'
                    }
                ]
            }
            , {
                name: 'lockDate',
                type: 'date',
                maxName: 'lockDateMax',
                minName: 'lockDateMin',
                showTime: '1'
            }
            //,{
            //     name:'gmtModified',
            //     type: 'date',
            //     maxName:'gmtModifiedMax',
            //     minName:'gmtModifiedMin'
            // }
        ];

    }

    rowHandles = (strHandles, rowObj) => {
    }






    //刷新列表
    refreshHandle = () => {
        this.refs.listWorkarea.refreshHandle();
    }

    componentDidMount() {

    }




    render() {
        //当左侧隐藏时，列表宽度加上左侧的宽度，
        //1、当前this.props.isHideLeft 是从页面组件containers/Main/main.js传过来
        //2、this.props.isHideLeft 最顶级赋值是在页面 containers/Main/main.js
        let isHideLeft = this.props.isHideLeft;

        return (
            <div>
                <ListBox
                    ref='listLockLog'
                    title="原材料冻结解冻日志"
                    isHideLeft={isHideLeft}
                    tableColumnData={this.tableColumn}
                    searchComponentData={this.searchComponentData}
                    url='/material/insidewarehouse/locklog/list'
                    rowHandles={this.rowHandles}
                    rowOperation={this.rowOperation}
                    headerOperation={this.headerOperation}
                    isRowSingle="true"
                />
            </div>
        )
    }
}
